package com.tuanzi.loan.web.lazy.family;

import com.tuanzi.loan.business.service.family.ProductInfoService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.ProductInfoSearchRequest;
import com.tuanzi.loan.vo.response.family.ProductInfoSearchResponse;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class ApiProductInfoLazyDataModel extends
        BaseLazyDataModel<ProductInfoSearchRequest, ProductInfoSearchResponse> {

    private static final long serialVersionUID = 9143007553234885156L;

    private ProductInfoService productInfoService = SpringContextHolder
            .getBean(ProductInfoService.class);

    public ApiProductInfoLazyDataModel(ProductInfoSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<ProductInfoSearchResponse> doLoad(
            PageSearcher<ProductInfoSearchRequest> pageSearcher) {
        return productInfoService.getApilist(pageSearcher);
    }
}
